/*
 * @Author: TT-hzy 
 * @Date: 2024-06-29 14:25:10
 * @LastEditors: TT-hzy 
 * @LastEditTime: 2024-07-01 17:01:22
 * @Description: 
 */

import moment from "moment";


export default {
  parseInt(str: string | number) {
    if (typeof str === 'number') return str;
    if (!str) return 0;
    return parseInt(str) || 0;
  },

  cTime() {
    return +new Date();
  },

  relativeTimeRounding(time: any, format: any = 'YYYY-MM-DD HH:mm:ss') {

    return moment(time).format(format);
  }
}